package com.euond.permission.api;

import com.euond.permission.service.DataPrivilegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by user on 2018/7/17.
 */
@RestController
@RequestMapping("/permission/api/dataprivileges")
public class DataPrivilegeFeignController {

    @Autowired
    private DataPrivilegeService dataPrivilegeService;

    /**
     * 拼接数据权限过滤SQL
     */
    @GetMapping(value = "/targetsql")
    public String getTargetSql(@RequestParam(value="orgSql") String orgSql) {
        return dataPrivilegeService.handlerTablePrivilege(orgSql);
    }
}
